/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.delivery.dao;

import com.mycompany.delivery.entities.Contact;
import com.mycompany.delivery.entities.Delivery;
import com.mycompany.delivery.entities.State;
import java.util.Date;
import java.util.List;

/**
 *
 * @author Martin Horvath
 */
public interface DeliveryDAO {

    /**
     * Creates delivery in the database
     * @param delivery 
     */
    public void createDelivery(Delivery delivery);

    /**
     * Updates existing delivery in the database
     * @param delivery 
     */
    public void updateDelivery(Delivery delivery);

    /**
     * Removes given delivery from the database
     * @param delivery 
     */
    public void deleteDelivery(Delivery delivery);


    /**
     * Gets delivery from the database with a given id
     * @param id
     * @return Delivery with given id
     */
    public Delivery getDeliveryById(Long id);

    /**
     * Gets all deliveries from the database
     * @return 
     */
    public List<Delivery> getAllDeliveries();

    /**
     * Gets all deliveries with given sending date
     * @param date
     * @return List of deliveries with given sending date
     */
    public List<Delivery> getDeliveriesBySendingDate(Date date);

    /**
     * Gets all deliveries with given receiving date
     * @param date
     * @return List of deliveries with give receiving date
     */
    public List<Delivery> getDeliveriesByReceivingDate(Date date);
     

    /**
     * Gets all deliveries with given state
     * @param state
     * @return List of deliveries with given state
     */
    public List<Delivery> getDeliveriesByState(State state);
    

    /**
     * Gets all deliveries with given sender
     * @param sender
     * @return List of all deliveries with given sender
     */
    public List<Delivery> getDeliveriesBySender(Contact sender);
    
    /**
     * Gets all deliveries with given receiver
     * @param receiver
     * @return List of all deliveries with given receiver
     */
    public List<Delivery> getDeliveriesByReceiver(Contact receiver);
    
}
